$(function () {
    var setMtime = function (h) {
        var data = new Date();
        let nowH = data.getHours();
        let nowF = data.getMinutes();
        let nowS = data.getSeconds();
        let nowM = data.getMilliseconds();
        let m = h * 60 * 60 * 1000 - (nowH * 60 * 60 * 1000 + nowF * 60 * 1000 + nowS * 1000 + nowM);
        let mS = parseInt((m / 1000) % 60)  //秒
        mS = mS < 10 ? "0" + mS : mS;
        let mF = parseInt((m / 1000 / 60) % 60) //分钟
        mF = mF < 10 ? "0" + mF : mF;
        let mH = parseInt((m / 1000 / 60 / 60) % 24) //小时
        mH = mH < 10 ? "0" + mH : mH;
        // let mtime = `距结束 ${mH}:${mF}:${mS}`;
        $(".seckill .djs .hour").html(mH);
        $(".seckill .djs .min").html(mF);
        $(".seckill .djs .sec").html(mS);
    }


    setInterval(function () {
        var data = new Date();
        if (data.getHours() > 12) {
            setMtime(24);
        } else {
            chang = 12;
            setMtime(12);
        }
    }, 100)
})
